import upload from '@/utils/upload'
import request from '@/utils/request'



// 查询用户个人信息
export function getUserProfile() {
  return request({
    url: '/system/user/profile/get',
    method: 'GET'
  })
}


export function sendSmsCode(data) {
  return request({
    url: '/system/auth/send-sms-code',
    method: 'POST',
    data: data
  })
}


// 修改用户个人信息
export function updateUserProfile(data) {
  return request({
    url: '/system/user/profile/update',
    method: 'PUT',
    data: data
  })
}

// 用户头像上传
export function uploadAvatar(data) {
  return upload({
    url: '/system/user/profile/update-avatar',
    method: 'PUT',
    name: data.name,
    filePath: data.filePath
  })
}

// 修改手机号
export function updatePhone(data) {
  return request({
    url: '/system/user/updatePhone',
    method: 'PUT',
    data: data
  })
}
// 重置用户密码
export function updatePassword(data) {
  return request({
    url: '/system/user/update-password',
    method: 'PUT',
    data: data
  })
}
// 忘记密码
export function forgetPassword(data) {
  return request({
    url: '/system/user/forgetPassword',
    method: 'PUT',
    data: data
  })
}
// 注销用户
export function bannedUser(data) {
  return request({
    url: '/system/user/bannedUser',
    method: 'PUT',
    data: data
  })
}
